//雇主的请求封装
import request from "@/utils/http.ts"

//1.查询雇主个人信息
export const queryEmployerPersonalAPI = (employerId: string) => {
    return request({
        url: 'employer/queryEmployerPersonal',
        method: 'post',
        params: {
            employerId: employerId,
        }
    })
}
//2.更新雇主个人信息
export const updateEmployerPersonalAPI = (data: any) => {
    return request({
        url: 'employer/updateEmployerPersonal',
        method: 'post',
        data: {
            employerId: data.employerId,
            employerCompanyName: data.employerCompanyName,
            employerUsername: data.employerUsername,
            employerPhone: data.employerPhone,
            employerName: data.employerName,
            employerCompanyAddress: data.employerCompanyAddress,
            employerCompanyIndustry: data.employerCompanyIndustry,
            employerCompanyDescription: data.employerCompanyDescription,
            employerCompanyWebsite: data.employerCompanyWebsite,
            userAvatarUrl: data.userAvatarUrl,//头像
        }
    })
}
//3.查询公司信息根据ID
export const getEmployerDetailByEmployerIdAPI = (employerId: string) => {
    return request({
        url: 'employer/getEmployerDetailByEmployerId',
        method: 'post',
        params: {
            employerId: employerId,
        }
    })
}

//4.管理员-修改雇主状态
export const updateEmployerStatusAPI = (data: any) => {
    return request({
        url: 'employer/updateEmployerStatus',
        method: 'post',
        params: {
            employerId: data.employerId,
            employerStatus: data.employerStatus,
        }
    })
}

//5.管理员-分页获取雇主信息
export const getEmployerAdminPageAPI = (data: any) => {
    return request({
        url: 'employer/getEmployerAdminPage',
        method: 'post',
        data: {
            pageCurrent: data.pageCurrent,
            pageSize: data.pageSize,
            searchName: data.searchName,
            employerStatus: data.employerStatus,
            employerIsVerified:data.employerIsVerified,
        }
    })
}
//6.管理员-修改雇主认证状态
export const updateEmployerVerifiedAPI = (data: any) => {
    return request({
        url: 'employer/updateEmployerVerified',
        method: 'post',
        params: {
            employerId: data.employerId,
            employerIsVerified: data.employerIsVerified,
        }
    })
}
